VT-d: improve save/restore of registers across S3
authorJan Beulich <jbeulich@suse.com>
Tue, 13 Apr 2021 08:14:23 +0000 (10:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 13 Apr 2021 08:14:23 +0000 (10:14 +0200)
commit27713fa2aa2166407bb962e80a39480f7ca5cee2
tree2166ffdbdd581e80d2856740caa601560b904900
parentbe167ac0f0268074880b961c936519f756ac045b
VT-d: improve save/restore of registers across S3

The static allocation of the save space is not only very inefficient
(most of the array slots won't ever get used), but is also the sole
reason for a build-time upper bound on the number of IOMMUs. Introduce
a structure containing just the one needed field we can't (easily)
restore from other in-memory state, and allocate the respective
array dynamically.

Take the opportunity and make the FEUADDR write dependent upon
x2apic_enabled, like is already the case in dma_msi_set_affinity().

Also alter properties of nr_iommus: static, unsigned, and __initdata.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/iommu.h
xen/include/asm-x86/iommu.h